using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ccr
{
    [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
    public class HandlerAttribute : Attribute
    {
        private readonly Behavior m_behavior;
        private bool m_isPersist;
        private int m_delay;

        public HandlerAttribute(Behavior behavior = Behavior.Exclusive)
        {
            m_behavior = behavior;
            m_isPersist = behavior != Behavior.Teardown;
            m_delay = 0;
        }

        public Behavior Behavior
        {
            get { return m_behavior; }
        }       
        public bool IsPersist
        {
            get { return m_isPersist; }
            set { m_isPersist = value; }
        }
        public int Delay
        {
            get { return m_delay; }
            set { m_delay = value; }
        }
    }
}
